package com.net.xpay.admin.controller.admin;

import com.net.common.model.ResultData;
import com.net.xpay.common.domain.notification.Notification;
import com.net.xpay.common.service.notification.NotificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/admin/notification")
@Api(tags = "运营端/系统公告", description = "运营端 系统公告 net")
public class AdminNotificationController {

    @Autowired
    private NotificationService notificationService;

    @ApiOperation(value = "创建公告")
    @PostMapping
    public ResultData<Long> addNotification(@RequestBody Notification notification) {
        return new ResultData<>(notificationService.addNotification(notification));
    }

    @ApiOperation(value = "修改公告")
    @PutMapping
    public ResultData<Long> updateNotification(@RequestBody Notification notification) {
        return new ResultData<>(notificationService.updateNotification(notification));
    }
}
